﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace BanXeTang
{
    class HieuUngNo
    {
        private MySprite _spriteNo;
        private int nTexture;
        private int nDelay;
        private int iDelay;
        

        public MySprite SpriteNo
        {
            get { return _spriteNo; }
            set { _spriteNo = value; }
        }

        public int NTexture
        {
            get { return nTexture; }
            set { nTexture = value; }
        }


        public HieuUngNo(ContentManager Content, int _nTexture, float x, float y)
        {
            NTexture = _nTexture;
            SpriteNo = new MySprite(GlobalSettings.textureNo, x, y);
            SpriteNo._itexture2d = -1;
            nDelay = 10;
            iDelay = 0;
        }  


        public void Update(GameTime gameTime )
        {
            if (iDelay == 0)
                SpriteNo.Update(gameTime);
            iDelay = (iDelay + 1) % nDelay;
        }

        public bool KetThuc()
        {
            return (SpriteNo._itexture2d == NTexture - 1);
        }
        

        public void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            SpriteNo.Draw(gameTime, spriteBatch, Color.White);
        }
    }
}
